from pandas import DataFrame

from data_mining.utils.date_util import parse_date
from data_mining.utils.get_data_util import get_data
from data_mining.utils.sort_util import sort_data

'''
预处理
'''


def preprocess_info(path) -> DataFrame:
    datas = get_data(path)

    # 数据去重
    datas.drop_duplicates(inplace=True)
    time = datas.columns[0]

    # 转换时间
    parse_date(datas, time)

    # 排序
    sort_data(datas, time)
    return datas

